﻿<ResourceDictionary 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d" xmlns:local="clr-namespace:Demo.Controls">
    <Style TargetType="local:DockPanel">
        <Setter Property="Foreground" Value="White"/>
        <Setter Property="FontSize" Value="12"/>
        <Setter Property="Background">
            <Setter.Value>
                <SolidColorBrush Color="#003366" Opacity="0.6"/>
            </Setter.Value>
        </Setter>
        <Setter Property="BorderBrush" Value="#949494"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="MinHeight" Value="50"/>
        <Setter Property="MinWidth" Value="100"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:DockPanel">
                    <Grid>
                        <local:DockButton x:Name="LeftButton" Content="{TemplateBinding Header}" HorizontalAlignment="Right" VerticalAlignment="Top" FontSize="{TemplateBinding FontSize}" Foreground="{TemplateBinding Foreground}"
                                           Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"/>
                        <Grid x:Name="LeftPanel" Margin="0,0,27,0">
                            <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="6,0,6,6"/>
                            <ItemsPresenter Margin="8,8,8,8"/>
                        </Grid>
                        <local:DockButton x:Name="RightButton" DockDirection="Right" Visibility="Collapsed" Content="{TemplateBinding Header}" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="{TemplateBinding FontSize}" Foreground="{TemplateBinding Foreground}"
                                           Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"/>
                        <Grid x:Name="RightPanel" Visibility="Collapsed" Margin="26,0,0,0">
                            <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="0,6,6,6"/>
                            <ItemsPresenter Margin="8,8,8,8"/>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>